#ifndef _FENGINE_SKYDOME
#define _FENGINE_SKYDOME

#include <vector>
#include "CoreEngine.h"
#include "FEngineType.h"
#include "Node.h"

namespace FEngine
{
	/**
	 * Abstract class used to create basic shapes.
	 */
	class SkyDome : public Node
	{

		public:

			/**
			 * Constructor.
			 * @param _fileName Name of the texture file to use as the cube map texture.
			 * @param _rotationSpeed Speed of the rotation in deegree per seconds.
			 */
			SkyDome(const std::string& _fileName, float _rotationSpeed = 0);
			virtual ~SkyDome();
			
			/**
			 * Change the texture of the sky dome.
			 * @param _fileName Name of the texture file to use as the cube map texture.
			 */
			void setTexture(const std::string& _fileName);

			/**
			 * Set the rotation speed of the sky dome.
			 * @param _speed Speed of the rotation in deegree per seconds.
			 */
			void setRotateSpeed(float _speed);
			

			virtual void update(double _elapsedTime);
			virtual void render(double _elapsedTime);
			
		protected:

			LPDIRECT3DVERTEXBUFFER9			mVertexBuffer;
			IDirect3DVertexDeclaration9*	mVertexDeclaration;
			LPDIRECT3DINDEXBUFFER9			mIndexBuffer;
			IDirect3DCubeTexture9*			mCubeMapTexture;
			
			int								mNumberVertices;
			int								mNumberPrimitives;
			float							mRotateSpeed;

		private:
			
			void _createSphere(const std::string& _fileName);
	};

} // namespace FEngine

#endif
